Feature: Refresh button#3447
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds per-widget refresh controls to the Dashboard widgets and consolidates widget “check/reload” invocation under a single CheckCommand, with UI feedback (spinning refresh icon) during an active check.
Changes:
- Replaced hotkey-only widget check commands with
CheckCommandand bound F5 + a new refresh button to it in each widget view. - Added “reloading” animations in widget headers while checks are in progress.
- Removed the StatusWindow-level reload button/command and adjusted dashboard check invocation behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Source/NETworkManager/Views/NetworkConnectionWidgetView.xaml | Binds F5 and a new header refresh button to CheckCommand and shows reload animation via IsChecking. |
| Source/NETworkManager/Views/IPApiIPGeolocationWidgetView.xaml | Adds header refresh button + animation and rebinds F5 to CheckCommand. |
| Source/NETworkManager/Views/IPApiDNSResolverWidgetView.xaml | Adds header refresh button + animation and rebinds F5 to CheckCommand. |
| Source/NETworkManager/Views/DashboardView.xaml.cs | Calls widget Check() methods directly; limits “visible” refresh to the network-connection widget. |
| Source/NETworkManager/ViewModels/NetworkConnectionWidgetViewModel.cs | Introduces IsChecking for UI feedback and exposes CheckCommand. |
| Source/NETworkManager/ViewModels/IPApiIPGeolocationWidgetViewModel.cs | Replaces hotkey command with CheckCommand and removes internal re-entrancy guard. |
| Source/NETworkManager/ViewModels/IPApiDNSResolverWidgetViewModel.cs | Replaces hotkey command with CheckCommand and removes internal re-entrancy guard. |
| Source/NETworkManager/StatusWindow.xaml.cs | Removes ReloadCommand. |
| Source/NETworkManager/StatusWindow.xaml | Removes the window command-bar reload button. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
94
to
98
| // Check is disabled via settings | ||
| if (!SettingsManager.Current.Dashboard_CheckIPApiDNSResolver) | ||
| return; | ||
|
|
||
| // Don't check multiple times if already running | ||
| if (IsRunning) | ||
| return; | ||
|
|
||
| IsRunning = true; |
Comment on lines
568
to
572
| _cancellationTokenSource.Dispose(); | ||
| } | ||
| } | ||
|
|
||
| _cancellationTokenSource = new CancellationTokenSource(); |
Comment on lines
+186
to
+189
| <Button Grid.Column="2" Command="{Binding CheckCommand}" | ||
| Style="{StaticResource CleanButton}" | ||
| VerticalAlignment="Center"> | ||
| <Rectangle Width="20" Height="20" |
Comment on lines
+59
to
+62
| <Button Grid.Column="2" Command="{Binding CheckCommand}" | ||
| Style="{StaticResource CleanButton}" | ||
| VerticalAlignment="Center"> | ||
| <Rectangle Width="20" Height="20" |
Comment on lines
+56
to
+59
| <Button Grid.Column="2" Command="{Binding CheckCommand}" | ||
| Style="{StaticResource CleanButton}" | ||
| VerticalAlignment="Center"> | ||
| <Rectangle Width="20" Height="20" |
Comment on lines
+1
to
3
|
|
||
| using NETworkManager.ViewModels; | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes proposed in this pull request
Copilot generated summary
Provide a Copilot generated summary of the changes in this pull request.
Copilot summary
This pull request refactors and streamlines the check/reload functionality across the dashboard widgets in the application. It replaces the previous "Reload" and "Check via hotkey" commands with a unified
CheckCommandfor each widget, updates the UI to include consistent reload buttons with animated feedback, and simplifies the codebase by removing redundant commands and methods. Additionally, it improves the user experience by providing visual feedback during ongoing checks.Command and Code Refactoring:
ReloadCommandandCheckViaHotkeyCommandimplementations with a singleCheckCommandfor each widget's ViewModel, and removed associated redundant methods and actions (ReloadAction,CheckViaHotkeyAction). The new command also disables itself while a check is running for better UX. [1] [2] [3] [4]IsRunningin async check methods, as this is now handled by command logic. [1] [2]UI/UX Improvements:
CheckCommandinstead of the old commands, and added a reload button with a spinning animation during checks, providing immediate visual feedback to the user. [1] [2] [3] [4] [5] [6] [7] [8] [9]Widget State Management:
IsCheckingproperty inNetworkConnectionWidgetViewModel(and usedIsRunningin others) to track when a check is in progress, updating the UI accordingly. [1] [2] [3]Dashboard Coordination:
Check()method and directly invoking individual widget checks, ensuring all widgets are checked on dashboard load and only the network connection widget is checked when the view becomes visible.Cleanup and Consistency:
To-Do
Contributing
By submitting this pull request, I confirm the following: